package com.tarena.lbs.basic.web.assemble;

import com.alibaba.fastjson.JSON;
import com.tarena.lbs.pojo.basic.vo.AreaVO;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class AreaAssembler {
    public List<AreaVO> assembleAreaTree(){
        //classpath路径 类加载器读取资源 读取流 拿到文本
        String tree="[{\n" +
                "  \"id\": 1,\n" +
                "  \"parentId\": 0,\n" +
                "  \"name\": \"北京市\",\n" +
                "  \"children\": [{\n" +
                "    \"id\": 2,\n" +
                "    \"parentId\": 1,\n" +
                "    \"name\": \"北京市市辖区\",\n" +
                "    \"children\": [{\n" +
                "      \"id\": 3,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"东城区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 4,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"西城区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 5,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"朝阳区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 6,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"丰台区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 7,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"石景山区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 8,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"海淀区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 9,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"门头沟区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 10,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"房山区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 11,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"通州区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 12,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"顺义区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 13,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"昌平区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 14,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"大兴区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 15,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"怀柔区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 16,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"平谷区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 17,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"密云区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 18,\n" +
                "      \"parentId\": 2,\n" +
                "      \"name\": \"延庆区\",\n" +
                "      \"children\": null\n" +
                "    }]\n" +
                "  }]\n" +
                "}," +
                "{\n" +
                "  \"id\": 2441,\n" +
                "  \"parentId\": 0,\n" +
                "  \"name\": \"重庆市\",\n" +
                "  \"children\": [{\n" +
                "    \"id\": 2442,\n" +
                "    \"parentId\": 2441,\n" +
                "    \"name\": \"重庆市市辖区\",\n" +
                "    \"children\": null\n" +
                "  }, {\n" +
                "    \"id\": 2469,\n" +
                "    \"parentId\": 2441,\n" +
                "    \"name\": \"重庆市郊县\",\n" +
                "    \"children\": [{\n" +
                "      \"id\": 2443,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"万州区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2444,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"涪陵区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2445,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"渝中区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2446,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"大渡口区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2447,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"江北区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2448,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"沙坪坝区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2449,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"九龙坡区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2450,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"南岸区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2451,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"北碚区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2452,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"綦江区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2453,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"大足区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2454,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"渝北区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2455,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"巴南区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2456,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"黔江区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2457,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"长寿区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2458,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"江津区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2459,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"合川区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2460,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"永川区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2461,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"南川区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2462,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"璧山区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2463,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"铜梁区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2464,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"潼南区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2465,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"荣昌区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2466,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"开州区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2467,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"梁平区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2468,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"武隆区\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2470,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"城口县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2471,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"丰都县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2472,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"垫江县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2473,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"忠县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2474,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"云阳县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2475,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"奉节县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2476,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"巫山县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2477,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"巫溪县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2478,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"石柱土家族自治县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2479,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"秀山土家族苗族自治县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2480,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"酉阳土家族苗族自治县\",\n" +
                "      \"children\": null\n" +
                "    }, {\n" +
                "      \"id\": 2481,\n" +
                "      \"parentId\": 2469,\n" +
                "      \"name\": \"彭水苗族土家族自治县\",\n" +
                "      \"children\": null\n" +
                "    }]\n" +
                "  }]\n" +
                "}]";
        List<AreaVO> areaVOS = JSON.parseArray(tree, AreaVO.class);
        return areaVOS;
    }
}
